﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 库区基础输入参数
/// </summary>
public class ReservoirBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 库区编码
    /// </summary>
    [Required(ErrorMessage = "库区编码不能为空")]
    public virtual string? ReservoirEncode { get; set; }
    
    /// <summary>
    /// 库区名称
    /// </summary>
    [Required(ErrorMessage = "库区名称不能为空")]
    public virtual string? ReservoirName { get; set; }
    
    /// <summary>
    /// 面积
    /// </summary>
    [Required(ErrorMessage = "面积不能为空")]
    public virtual int? ReservoirArea { get; set; }
    
    /// <summary>
    /// 负责人
    /// </summary>
    [Required(ErrorMessage = "负责人不能为空")]
    public virtual string? ReservoirHead { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
    /// <summary>
    /// 仓库编号
    /// </summary>
    [Required(ErrorMessage = "仓库编号不能为空")]
    public virtual long? WarehouseId { get; set; }
    
}

/// <summary>
/// 库区分页查询输入参数
/// </summary>
public class PageReservoirInput : BasePageInput
{
    /// <summary>
    /// 库区编码
    /// </summary>
    public string? ReservoirEncode { get; set; }
    
    /// <summary>
    /// 库区名称
    /// </summary>
    public string? ReservoirName { get; set; }
    
    /// <summary>
    /// 面积
    /// </summary>
    public int? ReservoirArea { get; set; }
    
    /// <summary>
    /// 负责人
    /// </summary>
    public string? ReservoirHead { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 仓库编号
    /// </summary>
    public long? WarehouseId { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 库区增加输入参数
/// </summary>
public class AddReservoirInput
{
    /// <summary>
    /// 库区编码
    /// </summary>
    [Required(ErrorMessage = "库区编码不能为空")]
    [MaxLength(32, ErrorMessage = "库区编码字符长度不能超过32")]
    public string? ReservoirEncode { get; set; }
    
    /// <summary>
    /// 库区名称
    /// </summary>
    [Required(ErrorMessage = "库区名称不能为空")]
    [MaxLength(32, ErrorMessage = "库区名称字符长度不能超过32")]
    public string? ReservoirName { get; set; }
    
    /// <summary>
    /// 面积
    /// </summary>
    [Required(ErrorMessage = "面积不能为空")]
    public int? ReservoirArea { get; set; }
    
    /// <summary>
    /// 负责人
    /// </summary>
    [Required(ErrorMessage = "负责人不能为空")]
    [MaxLength(32, ErrorMessage = "负责人字符长度不能超过32")]
    public string? ReservoirHead { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(32, ErrorMessage = "备注字符长度不能超过32")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 仓库编号
    /// </summary>
    [Required(ErrorMessage = "仓库编号不能为空")]
    public long? WarehouseId { get; set; }
    
}

/// <summary>
/// 库区删除输入参数
/// </summary>
public class DeleteReservoirInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 库区更新输入参数
/// </summary>
public class UpdateReservoirInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 库区编码
    /// </summary>    
    [Required(ErrorMessage = "库区编码不能为空")]
    [MaxLength(32, ErrorMessage = "库区编码字符长度不能超过32")]
    public string? ReservoirEncode { get; set; }
    
    /// <summary>
    /// 库区名称
    /// </summary>    
    [Required(ErrorMessage = "库区名称不能为空")]
    [MaxLength(32, ErrorMessage = "库区名称字符长度不能超过32")]
    public string? ReservoirName { get; set; }
    
    /// <summary>
    /// 面积
    /// </summary>    
    [Required(ErrorMessage = "面积不能为空")]
    public int? ReservoirArea { get; set; }
    
    /// <summary>
    /// 负责人
    /// </summary>    
    [Required(ErrorMessage = "负责人不能为空")]
    [MaxLength(32, ErrorMessage = "负责人字符长度不能超过32")]
    public string? ReservoirHead { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(32, ErrorMessage = "备注字符长度不能超过32")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 仓库编号
    /// </summary>    
    [Required(ErrorMessage = "仓库编号不能为空")]
    public long? WarehouseId { get; set; }
    
}

/// <summary>
/// 库区主键查询输入参数
/// </summary>
public class QueryByIdReservoirInput : DeleteReservoirInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataReservoirInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 库区数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportReservoirInput : BaseImportInput
{
    /// <summary>
    /// 库区编码
    /// </summary>
    [ImporterHeader(Name = "*库区编码")]
    [ExporterHeader("*库区编码", Format = "", Width = 25, IsBold = true)]
    public string? ReservoirEncode { get; set; }
    
    /// <summary>
    /// 库区名称
    /// </summary>
    [ImporterHeader(Name = "*库区名称")]
    [ExporterHeader("*库区名称", Format = "", Width = 25, IsBold = true)]
    public string? ReservoirName { get; set; }
    
    /// <summary>
    /// 面积
    /// </summary>
    [ImporterHeader(Name = "*面积")]
    [ExporterHeader("*面积", Format = "", Width = 25, IsBold = true)]
    public int? ReservoirArea { get; set; }
    
    /// <summary>
    /// 负责人
    /// </summary>
    [ImporterHeader(Name = "*负责人")]
    [ExporterHeader("*负责人", Format = "", Width = 25, IsBold = true)]
    public string? ReservoirHead { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 仓库编号 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? WarehouseId { get; set; }
    
    /// <summary>
    /// 仓库编号 文本
    /// </summary>
    [ImporterHeader(Name = "*仓库编号")]
    [ExporterHeader("*仓库编号", Format = "", Width = 25, IsBold = true)]
    public string WarehouseFkDisplayName { get; set; }
    
}
